Engine
Provides access to the Chromium engine functionality.
To perform operations with the engine, a license key is required. The license key represents a string that can be set via the "jxbrowser.license.key" system property or individually for every Engine
using the licenseKey method. If you set the license key via the system property, then please make sure that you set it before creating an Engine
instance.
The Chromium engine is running in a separate native process. Communication between the native and Java process is done through the Inter-Process Communication (IPC) layer that allows transferring data between two processes on a local machine.
The native process allocates memory and system resources that must be released. So, when the engine is no longer needed, it must be closed through the close method to shutdown the native process and free all the allocated memory and system resources. For example:
Engine engine = Engine.newInstance(engineOptions);
...
engine.close();
Any attempt to use an already closed engine will lead to the IllegalStateException
.
To get notifications that the Engine
instance has been closed subscribe to the following event:
engine.on(EngineClosed.class, event -> {
// The engine has been closed.
});
Engine
instance has been unexpectedly terminated use:
engine.on(EngineCrashed.class, event -> {
// The engine has been unexpectedly terminated.
});
Functions
Browser
instance under the default profile and navigates it to the "about:blank" web page within the defaultTimeout.options
.renderingMode
.